<?php
	class wordsControl extends commonControl{
		function index(){
			$db = M("contact");
			$rows = $db -> findall();
			$this->assign("rows",$rows);
			$this->display();
		}

		function advice_show(){
			$num = $_GET["id"];
			$db = M("contact");
			$rows = $db -> find($num);
			$this->assign("rows",$rows);
			$this->display();
		}

		function del(){
			$num = $_GET["id"];
			$db = M("contact");
			if($db->del($num)){
				$this->success("删除成功","index");
			}else{
				$this->error("删除失败","index");
			}
		}

		function del_sel_all(){
			$db = M("contact");
			$nums = array_keys($_POST['del']);
			if($db -> del($nums)){
				$this->success("删除成功","index");
			}else{
				$this->error("删除失败","index");
			}
		}
	}
?>